/* Enhanced Common Styles for Arya Samaj Porbandar */
/* Supports Multiple Themes: Blue Light/Dark & Orange Light/Dark */

/* CSS Variables for Blue Theme - Light Mode */
:root,
[data-theme="blue-light"] {
    /* Primary Colors */
    --primary: #667eea;
    --secondary: #764ba2;
    --accent: #f093fb;
    --success: #4ecdc4;
    --error: #ff6b6b;
    --warning: #ffd93d;
    
    /* Text Colors */
    --text-primary: white;
    --text-secondary: rgba(255, 255, 255, 0.8);
    --text-muted: rgba(255, 255, 255, 0.6);
    
    /* Background Colors */
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --bg-card: rgba(255, 255, 255, 0.1);
    --bg-glass: rgba(255, 255, 255, 0.1);
    --bg-glass-hover: rgba(255, 255, 255, 0.2);
    
    /* Glass Morphism */
    --glass-border: rgba(255, 255, 255, 0.2);
    --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    
    /* Shadows */
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 30px 60px rgba(0, 0, 0, 0.15);
    
    /* Borders */
    --border: rgba(255, 255, 255, 0.2);
    
    /* Icon Colors */
    --icon-marriages: linear-gradient(45deg, #ff6b6b, #ff8e8e);
    --icon-role: linear-gradient(45deg, #4ecdc4, #7bd3cc);
    --icon-date: linear-gradient(45deg, #45b7d1, #6bb6d6);
}

/* Blue Theme - Dark Mode */
[data-theme="blue-dark"] {
    /* Primary Colors */
    --primary: #4c6ef5;
    --secondary: #5c7cfa;
    --accent: #be4bdb;
    --success: #20c997;
    --error: #fa5252;
    --warning: #ffd43b;
    
    /* Text Colors */
    --text-primary: #f8f9fa;
    --text-secondary: rgba(248, 249, 250, 0.8);
    --text-muted: rgba(248, 249, 250, 0.6);
    
    /* Background Colors */
    --bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-glass-hover: rgba(255, 255, 255, 0.1);
    
    /* Glass Morphism */
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    
    /* Shadows */
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 30px 60px rgba(0, 0, 0, 0.4);
    
    /* Borders */
    --border: rgba(255, 255, 255, 0.1);
    
    /* Icon Colors */
    --icon-marriages: linear-gradient(45deg, #fa5252, #ff8787);
    --icon-role: linear-gradient(45deg, #20c997, #51cf66);
    --icon-date: linear-gradient(45deg, #339af0, #74c0fc);
}

/* Orange Theme - Light Mode (Sanatan Dharm) */
[data-theme="orange-light"] {
    /* Primary Colors */
    --primary: #ff6b35;
    --secondary: #f7931e;
    --accent: #ffb347;
    --success: #4ecdc4;
    --error: #e74c3c;
    --warning: #f39c12;
    
    /* Text Colors */
    --text-primary: white;
    --text-secondary: rgba(255, 255, 255, 0.9);
    --text-muted: rgba(255, 255, 255, 0.7);
    
    /* Background Colors */
    --bg-gradient: linear-gradient(135deg, #ff6b35 0%, #f7931e 50%, #ffb347 100%);
    --bg-card: rgba(255, 255, 255, 0.15);
    --bg-glass: rgba(255, 255, 255, 0.15);
    --bg-glass-hover: rgba(255, 255, 255, 0.25);
    
    /* Glass Morphism */
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px rgba(255, 107, 53, 0.3);
    
    /* Shadows */
    --shadow: 0 20px 40px rgba(255, 107, 53, 0.2);
    --shadow-hover: 0 30px 60px rgba(255, 107, 53, 0.3);
    
    /* Borders */
    --border: rgba(255, 255, 255, 0.3);
    
    /* Icon Colors */
    --icon-marriages: linear-gradient(45deg, #e74c3c, #ec7063);
    --icon-role: linear-gradient(45deg, #f39c12, #f4d03f);
    --icon-date: linear-gradient(45deg, #d35400, #e67e22);
}

/* Orange Theme - Dark Mode */
[data-theme="orange-dark"] {
    /* Primary Colors */
    --primary: #fd7e14;
    --secondary: #e8590c;
    --accent: #fab005;
    --success: #20c997;
    --error: #e03131;
    --warning: #fab005;
    
    /* Text Colors */
    --text-primary: #f8f9fa;
    --text-secondary: rgba(248, 249, 250, 0.85);
    --text-muted: rgba(248, 249, 250, 0.65);
    
    /* Background Colors */
    --bg-gradient: linear-gradient(135deg, #2d1b0e 0%, #3d2b1f 50%, #4a1810 100%);
    --bg-card: rgba(255, 255, 255, 0.08);
    --bg-glass: rgba(255, 255, 255, 0.08);
    --bg-glass-hover: rgba(255, 255, 255, 0.15);
    
    /* Glass Morphism */
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    
    /* Shadows */
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    --shadow-hover: 0 30px 60px rgba(0, 0, 0, 0.5);
    
    /* Borders */
    --border: rgba(255, 255, 255, 0.15);
    
    /* Icon Colors */
    --icon-marriages: linear-gradient(45deg, #e03131, #ff6b6b);
    --icon-role: linear-gradient(45deg, #fab005, #ffd43b);
    --icon-date: linear-gradient(45deg, #fd7e14, #ff922b);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    overflow-x: hidden;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Theme Controls */
.theme-controls {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1002;
    display: flex;
    gap: 0.5rem;
}

.theme-btn {
    width: 50px;
    height: 50px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.theme-btn:hover {
    transform: scale(1.1);
    background: var(--bg-glass-hover);
    box-shadow: var(--glass-shadow);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1001;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.75rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    background: var(--bg-glass-hover);
    transform: scale(1.05);
}

/* Sidebar Overlay */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    padding: 2rem 0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1000;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, var(--bg-glass), transparent);
    z-index: -1;
}

.logo {
    text-align: center;
    margin-bottom: 3rem;
    padding: 0 2rem;
}

.logo h1 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.logo p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.nav-menu {
    list-style: none;
    padding: 0 1rem;
}

.nav-item {
    margin-bottom: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-link:hover, .nav-link.active {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
    transform: translateX(5px);
}

.nav-link i {
    margin-right: 1rem;
    font-size: 1.1rem;
}

/* Sidebar Close Button (Mobile) */
.sidebar-close {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-glass);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 0.5rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-close:hover {
    background: var(--bg-glass-hover);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    padding: 1.5rem 2rem;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    animation: slideDown 0.8s ease;
}

.welcome-text h2 {
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.welcome-text p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.profile-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: var(--glass-shadow);
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease;
    cursor: pointer;
}

.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.4s; }

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.05));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.stat-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 2;
}

.stat-title {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
}

.stat-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    filter: blur(10px);
    z-index: -1;
}

.stat-icon.marriages {
    background: var(--icon-marriages);
}

.stat-icon.role {
    background: var(--icon-role);
}

.stat-icon.date {
    background: var(--icon-date);
}

.stat-value {
    color: var(--text-primary);
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 2;
}

.stat-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    position: relative;
    z-index: 2;
}

/* Chart Section */
.chart-section {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid var(--glass-border);
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease;
    animation-delay: 0.6s;
}

.chart-header {
    margin-bottom: 2rem;
}

.chart-title {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.chart-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

.chart-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    background: var(--bg-card);
    border-radius: 15px;
    border: 2px dashed var(--glass-border);
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.chart-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.chart-placeholder:hover {
    background: var(--bg-glass-hover);
    border-color: var(--primary);
}

/* Footer */
.footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--glass-border);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    margin-top: 2rem;
}

/* Floating Particles */
.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: translateY(-100px) rotate(180deg);
        opacity: 0.8;
    }
}

/* Animations */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }
    
    .sidebar {
        position: fixed;
        left: -100%;
        top: 0;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
    }
    
    .sidebar.active {
        left: 0;
    }
    
    .sidebar-close {
        display: block;
    }
    
    .main-content {
        padding: 1rem;
        margin-left: 0;
    }
    
    .header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1.5rem;
    }
    
    .welcome-text h2 {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .chart-section {
        padding: 1.5rem;
    }
    
    .chart-placeholder {
        height: 200px;
    }
    
    .theme-controls {
        top: 5rem;
        right: 1rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-value {
        font-size: 1.8rem;
    }
    
    .welcome-text h2 {
        font-size: 1.3rem;
    }
    
    .welcome-text p {
        font-size: 1rem;
    }
    
    .main-content {
        padding: 0.5rem;
    }
}

/* Tablet Specific */
@media (min-width: 769px) and (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .sidebar {
        width: 250px;
    }
    
    .main-content {
        padding: 1.5rem;
    }
}

/* Large Screens */
@media (min-width: 1200px) {
    .dashboard-container {
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .main-content {
        padding: 3rem;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .stat-icon {
        transform: scale(0.9);
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .particle {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .sidebar,
    .theme-controls,
    .mobile-menu-toggle,
    .particles-container {
        display: none;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .stat-card,
    .header,
    .chart-section {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}